import http from '../http'

//获取列表
export const branchApi = () => http({
    url: "/brandFirst/select",
    method: "POST",
});

//删除
export const delBranch = (id) => http({
    url: "/brandFirst/deleteBrand",
    method: "POST",
    params: {
        id
    }
})

//添加
export const addBranch = (obj) => {
    // console.log('添加数据：',obj)
    return http({
        url: "/brandFirst/addBrandF",
        method: "POST",
        data: obj
    })
}

//分页
export const pageApi = (page, size) => http({
    url: "/brandFirst/selectByPage",
    method: "POST",
    params: {
        page,
        size
    }
})

//编辑
export const editBranch = (data) => http({
    url: "/brandFirst/updateBrand",
    method: "POST",
    data
})


//模糊查询
export const likeBranch = (name) => http({
    url: "/brandFirst/selectLike",
    method: "POST",
    params: {
        name
    }
})

//排序方式
export const sortApi = (sort) => {
    // console.log(sort)
    return http({
        url: "/brandFirst/changeSort",
        method: "POST",
        params: {
            sort
        }
    })
}
